package com.wzf.greattruth.jvm.classmodifier;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.PrintStream;

public class HackSystem {
    public final static InputStream in = System.in;
    private static ByteArrayOutputStream buff = new ByteArrayOutputStream();
    public final static PrintStream out = new PrintStream(buff);
    public final static PrintStream err = out;

    public static String getBufferString() {
        return buff.toString();
    }

    public static void clearBuffer() {
        buff.reset();
    }

    public static void setSecurityManager(final SecurityManager s) {
        System.setSecurityManager(s);
    }

    public static SecurityManager getSecurityManager() {
        return System.getSecurityManager();
    }

    public static long currrentTimeMillis() {
        return System.currentTimeMillis();
    }

    public static int identitiHashcode(Object o) {
        return System.identityHashCode(o);
    }

    public static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length) {
        System.arraycopy(src, srcPos, dest, destPos, length);
    }
}
